import body from '@/components/body'
import childView from '@/components/appMain.vue'

const templateTree = resolve => {
  require(['@/views/interface/template/tree.vue'], resolve)
}; //
const templateList = resolve => {
  require(['@/views/interface/template/list.vue'], resolve)
}; //
const templateEdit = resolve => {
  require(['@/views/interface/template/edit.vue'], resolve)
}; //
const templateReName = resolve => {
  require(['@/views/interface/template/rename.vue'], resolve)
}; //
const templateSetting = resolve => {
  require(['@/views/interface/template/setting.vue'], resolve)
}; //
const resourceTree = resolve => {
  require(['@/views/interface/resource/tree.vue'], resolve)
}; //
const resourceList = resolve => {
  require(['@/views/interface/resource/list.vue'], resolve)
}; //
const resourceEdit = resolve => {
  require(['@/views/interface/resource/edit.vue'], resolve)
}; //
const resourceReName = resolve => {
  require(['@/views/interface/resource/rename.vue'], resolve)
}; //
const userManageRouter = {
  path: '/userManager',
  name: '用户管理', //用户管理
  component: body,
  iconCls: 'icon-user',
  meta: {
    isLink: true
  },
  children: [{
    path: '/user',
    name: '用户信息管理',
    component: childView,
    isParent: true,
    redirect: '/user/list',
    children: [{
      path: '/user/list', //用户列表
      name: '用户列表',
      component: resolve => {
        require(['@/views/user/userMange/list.vue'], resolve)
      },
    },
      {
        path: '/user/save', //用户添加
        name: '用户添加',
        component: resolve => {
          require(['@/views/user/userMange/add.vue'], resolve)
        },
        hidden: true
      },
      {
        path: '/user/update', //用户添加
        name: '用户修改',
        component: resolve => {
          require(['@/views/user/userMange/edit.vue'], resolve)
        },
        hidden: true
      }
    ]
  },
    {
      path: '/group',
      name: '用户组管理', //用户组管理
      component: childView,
      isParent: true,
      redirect: '/group/list',
      children: [{
        path: '/group/list', //用户组列表
        name: '用户组列表',
        component: resolve => {
          require(['@/views/user/group/list.vue'], resolve)
        },
      }, {
        path: '/group/add', //用户组添加
        name: '用户组添加',
        component: resolve => {
          require(['@/views/user/group/add.vue'], resolve)
        },
      }, {
        path: '/group/edit', //用户组修改
        name: '用户组修改',
        component: resolve => {
          require(['@/views/user/group/edit.vue'], resolve)
        },
      }]
    },
    {
    path: '/role', //角色管理
    name: '角色管理',
    component: childView,
    isParent: true,
    redirect: '/role/list',
    children: [{
      path: '/role/list', //角色管理
      name: '角色管理',
      component: resolve => {
        require(['@/views/user/role/list.vue'], resolve)
      },
    },
      {
        path: '/role/save', //成员添加
        name: '角色添加',
        component: resolve => {
          require(['@/views/user/role/edit.vue'], resolve)
        },
        hidden: true
      },
      {
        path: '/role/update', //成员修改
        name: '角色修改',
        component: resolve => {
          require(['@/views/user/role/edit.vue'], resolve)
        },
        hidden: true
      },
      {
        path: '/role/members', //成员列表
        name: '成员列表',
        component: resolve => {
          require(['@/views/user/role/members.vue'], resolve)
        },
        hidden: true
      }
    ]
  },
  //   {
  //   path: '/account',
  //   name: '账户绑定', //用户管理
  //   component: childView,
  //   isParent: true,
  //   redirect: '/account/list',
  //   children: [{
  //     path: '/account/list', //用户列表
  //     name: '列表',
  //     component: resolve => {
  //       require(['@/views/user/account/list.vue'], resolve)
  //     },
  //   },]
  // },
    {
    path: '/adminGlobal',
    name: '管理员(全站)', //管理员(全站)
    component: childView,
    isParent: true,
    redirect: '/adminGlobal/list',
    children: [{
      path: '/adminGlobal/list', //管理员列表(全站)
      name: '管理员(全站)列表',
      component: resolve => {
        require(['@/views/user/admin/global/list.vue'], resolve)
      },
    }, {
      path: '/adminGlobal/edit', //管理员编辑页(全站)
      name: '管理员(全站)编辑',
      component: resolve => {
        require(['@/views/user/admin/global/edit.vue'], resolve)
      },
      hidden: true
    }, {
      path: '/adminGlobal/add', //管理员添加页(全站)
      name: '管理员(全站)添加',
      component: resolve => {
        require(['@/views/user/admin/global/add.vue'], resolve)
      },
      hidden: true
    }]
  }, {
    path: '/adminGlocal',
    name: '管理员(本站)', //管理员(本站)
    component: childView,
    isParent: true,
    redirect: '/adminGlocal/list',
    children: [{
      path: '/adminGlocal/list', //管理员列表(本站)
      name: '管理员(本站)列表',
      component: resolve => {
        require(['@/views/user/admin/glocal/list.vue'], resolve)
      },
    }, {
      path: '/adminGlocal/edit', //管理员编辑页(本站)
      name: '管理员(本站)修改',
      component: resolve => {
        require(['@/views/user/admin/glocal/edit.vue'], resolve)
      },
    }, {
      path: '/adminGlocal/add', //管理员添加页(本站)
      name: '管理员(本站)添加',
      component: resolve => {
        require(['@/views/user/admin/glocal/add.vue'], resolve)
      },
    }]
  }, {
    path: '/log',
    name: '操作日志', //操作日志
    component: childView,
    isParent: true,
    redirect: '/log/list',
    children: [{
      path: '/log/list', //日志列表
      name: '日志列表',
      component: resolve => {
        require(['@/views/user/log/list.vue'], resolve)
      },
    }]
  },
    {
      path: '/message',
      name: '站内信管理', //站内信管理
      component: childView,
      isParent: true,
      redirect: '/message/list',
      children: [{
        path: '/message/list', //站内信列表
        name: '站内信列表',
        component: resolve => {
          require(['@/views/user/message/list.vue'], resolve)
        },
      }, {
        path: '/message/add', //发送站内信
        name: '发送站内信',
        component: resolve => {
          require(['@/views/user/message/add.vue'], resolve)
        },
      }, {
        path: '/message/seek', //查看站内信
        name: '站内信查看',
        component: resolve => {
          require(['@/views/user/message/seek.vue'], resolve)
        },
      }, {
        path: '/message/reply', //回复站内信
        name: '站内信回复',
        component: resolve => {
          require(['@/views/user/message/reply.vue'], resolve)
        },
      }, {
        path: '/message/forward', //转发站内信
        name: '站内信转发',
        component: resolve => {
          require(['@/views/user/message/forward.vue'], resolve)
        },
      }]
    }]
}
export default userManageRouter
